package com.pine.manager.pineframework.trigger;

import com.pine.common.redis.cache.RedisCache;
import com.pine.common.trigger.AbstractTriggerTemplate;
import com.pine.common.trigger.TriggerType;
import com.pine.manager.config.ThreadPoolConfig;
import com.pine.manager.core.CipherComponent;
import com.pine.manager.pineframework.*;
import com.pine.manager.pineframework.convertors.*;
import jakarta.annotation.Resource;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.Executor;

/**
 * 抽象触发器模版-适配器<br>
 * 主要功能是注入各种依赖实例
 *
 * @author pine manage
 * @since 2024-08-16
 */
@Getter
@Setter
@Slf4j
public abstract class AbstractTriggerTemplateAdapter<TriggerRequest, TriggerResponse> extends AbstractTriggerTemplate<TriggerRequest, TriggerResponse> {

    // -- sysUser依赖 --
    @Resource
    protected SysUserManager sysUserManager;
    @Resource
    protected SysUserConvertor sysUserConvertor;

    // -- sysRole依赖 --
    @Resource
    protected SysRoleManager sysRoleManager;
    @Resource
    protected SysRoleConvertor sysRoleConvertor;

    // -- sysConfig依赖 --
    @Resource
    protected SysConfigManager sysConfigManager;
    @Resource
    protected SysConfigConvertor sysConfigConvertor;

    // -- sysRoleMenu依赖 --
    @Resource
    protected SysRoleMenuManager sysRoleMenuManager;
    @Resource
    protected SysRoleMenuConvertor sysRoleMenuConvertor;

    // --sysRoleUser依赖 --
    @Resource
    protected SysRoleUserManager sysRoleUserManager;
    @Resource
    protected SysRoleUserConvertor sysRoleUserConvertor;

    // --sysDict依赖 --
    @Resource
    protected SysDictManager sysDictManager;
    @Resource
    protected SysDictConvertor sysDictConvertor;

    // --sysDictItem依赖 --
    @Resource
    protected SysDictItemManager sysDictItemManager;
    @Resource
    protected SysDictItemConvertor sysDictItemConvertor;

    // --sysDept依赖 --
    @Resource
    protected SysDeptManager sysDeptManager;
    @Resource
    protected SysDeptConvertor sysDeptConvertor;

    // -- sysMenu依赖 --
    @Resource
    protected SysMenuManager sysMenuManager;
    @Resource
    protected SysMenuConvertor sysMenuConvertor;

    // -- 加密组件依赖 --
    @Resource
    protected CipherComponent cipherComponent;

    // -- redis缓存组件依赖 --
    @Resource
    protected RedisCache redisCache;

    // -- 业务线程池组件依赖 --
    @Resource(name = ThreadPoolConfig.BIZ_EXECUTOR_NAME)
    protected Executor executor;

    // -- 系统审批申请依赖 --
    @Resource
    protected SysApprovalApplicationManager sysApprovalApplicationManager;
    @Resource
    protected SysApprovalApplicationConvertor sysApprovalApplicationConvertor;

    // -- 系统审批历史依赖 --
    @Resource
    protected SysApprovalHistoryManager sysApprovalHistoryManager;
    @Resource
    protected SysApprovalHistoryConvertor sysApprovalHistoryConvertor;


    public AbstractTriggerTemplateAdapter(TriggerType triggerType) {
        super(triggerType);
    }
}
